#ifndef PREVIEWER_H
#define PREVIEWER_H


class UDockWidgetPreviewer {
public:
    UDockWidgetPreviewer();
    ~UDockWidgetPreviewer();
    virtual void previewBasicDocks(QDockItem* dragged_item) ;
    virtual std::unordered_set<Window> previewWidgets() const;
    virtual void showDockIndicators(QDockItem* target, DockOption dockoptions);
    virtual void showDockPreview(QDockItem* dragged_item, QDockItem* target, DockOption dockoption);
    virtual void moveWidget(QDockItem* widget, const QPoint & point, const QPoint & offset);
    virtual void hidePreviews() ;
    virtual void setDockManager(DockManager *dockmanager){
        m_dockmanager = dockmanager;
    }
    virtual DockOption hoveredIndicator(const QPoint &point, QWidget *target);
    virtual void unHover();
    virtual void highlightTarget(QWidget* target);
    virtual void unHighlightTarget();
    virtual void hideTargetDockIndicators();
    virtual void highlightSource(QWidget* source);
    virtual void unHighlightSource();

    virtual void highlightDocked(QWidget* target, const QRect &rec);
    virtual void unHighlightDocked();

    QPreviewWidget *getTargetPreviewWidget();

    QPreviewWidget *getSourcePreviewWidget();

protected:
    void showBaseIndicators(QDockItem *base_dock, DockOption dockoptions);
    void raiseBaseIndicators();
    void setHovered(QIndicator *indicator);
    void addBaseIndicator(QDockItem *base_dock, QIndicator *indicator, int x, int y);
protected:
    void previewToWidget(QPreviewWidget *previewer, QWidget *target, const QRect &geometry = QRect());

protected:
    QPreviewWidget* m_docked_previewer;
    QPreviewWidget* m_target_previewer;
    QPreviewWidget* m_source_previewer;
    UDockWidget* m_target_previewing;
    UDockWidget* m_source_previewing;
    QIndicator* m_hovering;
    DockManager* m_dockmanager;
    QMultiMap<QWidget*,QIndicator*> m_base_indicators;
    IndividualIndicators* m_individual_indicators;
};
#endif // PREVIEWER_H
